package com.cafe.service.impl;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cafe.dao.CafeInfoDao;
import com.cafe.model.CafeInfo;
import com.cafe.service.CafeInfoService;

/**
 * @Description：店铺信息业务接口实现类
 * @version v1.0
 */
@Service
public class CafeInfoServiceImpl implements CafeInfoService {
	@Autowired
	private CafeInfoDao cafeInfoDao;

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.cafe.service.CafeService#CafeInfomation(org.hibernate.criterion.
	 * DetachedCriteria)
	 */
	@Override
	public List listAllCafeInfos(DetachedCriteria criteria) {
		return cafeInfoDao.findByCriteria(criteria);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @param cafeInfo
	 * 
	 * @see
	 * com.cafe.service.CafeInfoService#saveCafeInfo(com.cafe.model.CafeInfo)
	 */
	@Override
	public void saveCafeInfo(CafeInfo cafeInfo) {
		cafeInfoDao.save(cafeInfo);

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @param cafeInfo
	 * 
	 * @see
	 * com.cafe.service.CafeInfoService#updateCafeInfo(com.cafe.model.CafeInfo)
	 */
	@Override
	public void updateCafeInfo(CafeInfo cafeInfo) {
		cafeInfoDao.update(cafeInfo);

	}

}
